home *** CD-ROM | disk | FTP | other *** search
- // Dynamic link library implementation of NeuroSolutions File component in ASCII mode
-
- #include "NSDLL.h"
- #include <stdio.h>
-
- /**********************************/
- /* Read next sample from file */
- __declspec(dllexport) BOOL performFile(
- DLLData *instance, // Pointer to instance data (may be NULL)
- FILE *file, // Pointer to the opened file
- NSFloat *sample // Location to place next sample
- )
- {
- if (fscanf(file, "%f", sample) != EOF)
- return TRUE;
- fclose(file);
- return FALSE;
- }
-
- /********************************************/
- /* Open and the file and return its pointer */
- __declspec(dllexport) FILE *openFile(DLLData *instance, const char *filePath)
- {
- return fopen(filePath, "r");
- }
-
- /******************************************/
- /* Management of instance data (OPTIONAL) */
- /*
- __declspec(dllexport) DLLData *allocFile(
- DLLData *oldInstance // Pointer to the last instance if reallocating
- )
- {
- DLLData *instance = NULL;
- return instance;
- }
-
- __declspec(dllexport) void freeFile(DLLData *instance)
- {
- freeDLLInstance(instance);
- }
- */
-